#!/usr/bin/python
# -*- coding: utf-8 -*-

from web.route import Router
from web.response import Response
from web.request import Request

def application(environ, start_response):  
    router = Router()  
    router('/', 'app.item.ItemList')
    router('/login', 'app.user.Login') 
    router('/logout', 'app.user.Logout') 
    router('/signup', 'app.user.Signup') 
    router('/notfound', 'app.error.NotFound') 
    router('/account', 'app.account.Account') 
    router('/account/buy', 'app.account.Bought') 
    router('/account/sell', 'app.account.Sale') 
    router('/item/add', 'app.item.AddItem') 
    router('/item/img', 'app.item.ShowImg') 
    router('/item/detail', 'app.item.ItemDetail') 
    router('/order', 'app.deal.Order') 
    router('/buy', 'app.deal.Buy') 

    ###根据路径路由到相应程序处理###
    ###############################
    req = Request(environ)
    resp = Response(start_response)
    return router.route(req, resp)   


        


